import {
    createStore
} from 'vuex'

import createPersistedState from "vuex-persistedstate";  //安装cnpm install --save vuex-persistedstate
import { menusList } from "@/http/api.js"
import user from "./modules/user"
import getters from "./getters"
import permission from "./modules/permission"

export default createStore({
    modules: {
        user,
        permission
    },
    getters,
    plugins: [
        createPersistedState({
            storage: window.localStorage,
            key: "store",
            render(state) {
                return {
                    ...state
                };
            }
        })
    ]
})
